using MediatR;
using RBAC.Domain.Dto.Output;
using RBAC.ErrorCode;
using RBAC.Read.Api.Application.Dto.ERP;
using System;

namespace RBAC.Read.Api.Application.Command.ERP.PurchasingManagement.PurchaseOrders
{
    /// <summary>
    /// 采购订单+物料联查（分页+条件）查询命令
    /// </summary>
    public class GetPurchaseOrdersWithMaterialsCommand : IRequest<APIPaging<PurchaseOrderWithMaterialDto>>
    {
        public int PageIndex { get; set; } = 1;
        public int PageSize { get; set; } = 10;

        /// <summary>
        /// 单据编码（模糊）
        /// </summary>
        public string? DocCode { get; set; }
        /// <summary>
        /// 跟单编号（模糊）
        /// </summary>
        public string? DocumentaryNumber { get; set; }
        /// <summary>
        /// 计划单号（模糊）
        /// </summary>
        public string? PlannedOrderNumber { get; set; }
        /// <summary>
        /// 供应商（模糊，按名称；若库中仅存ID则可按ID精确匹配）
        /// </summary>
        public string? Supplier { get; set; }
        /// <summary>
        /// 物料编码（模糊）
        /// </summary>
        public string? MaterialCode { get; set; }
        /// <summary>
        /// 物料名称（模糊）
        /// </summary>
        public string? MaterialName { get; set; }
        /// <summary>
        /// 单据日期-开始（过滤主表）
        /// </summary>
        public DateTime? DocDateStart { get; set; }
        /// <summary>
        /// 单据日期-结束（过滤主表）
        /// </summary>
        public DateTime? DocDateEnd { get; set; }
    }
}
